<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>金币订单-会员中心-<?php echo $cfg_webname;?></title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/style.css">
	</head>
	<body>
		<?php obtaintheme('top.htm');?>
		<main class="container py-3">
			<div class="row">
				<?php
				$_menu_order = true;
				$_menu_orderstate = 2;
				?>
				<?php include(DEDEMEMBER."/templets/menu.htm");?>
				<div class="col-md-9">
					<div class="pannel-main-container shadow-sm rounded">
						<div class="table-responsive">
							<table class="table">
								<thead>
									<tr>
										<th width="8%">#</th>
										<th width="8%">选择</th>
										<th width="16%">订单号</th>
										<th>产品</th>
										<th width="16%">信息</th>
										<th width="12%">状态</th>
										<th width="16%">时间</th>
									</tr>
								</thead>
								<tbody>
									<form name="form1" action="<?php echo $cfg_memberurl;?>/operation.php" method="post">
										<input type="hidden" name="ftype" value="del">
										{dede:datalist}
										<tr>
											<td>{dede:field.aid/}</td>
											<td><input type="checkbox" name="deleteid" value="{dede:field.aid/}"></td>
											<td>{dede:field.buyid/}</td>
											<td><?php echo $fields['pname']; ?></td>
											<td><?php echo $fields['oldinfo']; ?></td>
											<td>{dede:field.sta function="GetSta(@me)"/}</td>
											<td>{dede:field.mtime function="GetDateMk(@me)"/}</td>
										</tr>
										{/dede:datalist}
										<tr>
											<td colspan="6">
												<button type="button" id="checkedClick" class="btn btn-success btn-sm">全选</button>
												<button type="button" onclick="DoSubmit();" class="btn btn-danger btn-sm">删除</button>
											</td>
										</tr>
									</form>
								</tbody>
							</table>
						</div>
						{dede:pagelist listitem='info,index,end,pre,next,pageno' listsize='1'/}
					</div>
				</div>
			</div>
		</main>
		<?php obtaintheme('foot.htm');?>
		<script>
			//获得选中文件的文件名
			function GetCheckfolderItem() {
				var allSel = '';
				if (document.form1.deleteid.value) return document.form1.deleteid.value;
				for (i = 0; i < document.form1.deleteid.length; i++) {
					if (document.form1.deleteid[i].checked) {
						if (allSel == '')
							allSel = document.form1.deleteid[i].value;
						else
							allSel = allSel + "," + document.form1.deleteid[i].value;
					}
				}
				return allSel;
			}
			function DoSubmit() {
				var selid = GetCheckfolderItem();
				if (selid == '') {
					ShowMsg("您没选中任何信息");
					return false;
				}
				DedeConfirm("您确定要删除这些消息吗").then((v)=>{
					location = "operation.php?dopost=del&ids=" + selid;
				}).catch((e)=>{
					console.log(e)
				});
			}
		</script>
	</body>
</html>